//
//  BigImageCell.m
//  Product_NEWS
//
//  Created by dllo on 16/1/8.
//  Copyright © 2016年 FCH. All rights reserved.
//

#import "BigImageCell.h"
#import "titleLabel.h"
@interface BigImageCell ()
@property (nonatomic, retain) titleLabel *title;
@property (nonatomic, retain) UIImageView *imageTitle;
@property (nonatomic, retain) WordTite *readCount;
@property (nonatomic, retain) UIImageView *footImageView;


@end

@implementation BigImageCell

- (void)dealloc {
    [_imageTitle release];
    [_readCount release];
    [_title release];
    [_model release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self createSubView];
        
        
      

    }
    return self;
}



-(void)createSubView
{
    
    self.title = [[titleLabel alloc] initWithFrame:CGRectMake(5 * SCREEN_WIDTH, 0, 240* SCREEN_WIDTH, 30 * SCREEN_HEIGHT)];
     self.title.font = [UIFont systemFontOfSize:15 * SCREEN_WIDTH];
    [_title release];
    self.readCount = [[WordTite alloc] initWithFrame:CGRectMake(300 * SCREEN_WIDTH, 0, 75* SCREEN_WIDTH, 30 * SCREEN_HEIGHT)] ;
    self.readCount.font = [UIFont systemFontOfSize:13 * SCREEN_WIDTH                           ];
    [_readCount release];
    self.imageTitle = [[UIImageView alloc] initWithFrame:CGRectMake(5 * SCREEN_WIDTH, 35 * SCREEN_HEIGHT, 365* SCREEN_WIDTH, 150* SCREEN_HEIGHT)] ;
     self.imageTitle.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;
    self.footImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 205 * SCREEN_HEIGHT, 375 * SCREEN_WIDTH, 2 * SCREEN_HEIGHT)] ;
    
    self.footImageView.image = [UIImage imageNamed:@"mashup_shadow_bottom@2x.png"];
    [_footImageView release];
    [self.contentView addSubview:self.imageTitle];
    [self.contentView addSubview:self.title];
    [self.contentView addSubview:self.readCount];
    [self.contentView addSubview:self.footImageView];
}


#pragma mark - getter, setter





- (void)setModel:(NewsListModel *)model {
    if (_model != model) {
        [_model release];
        _model = [model retain];
        self.title.text = model.title;
        [self.imageTitle sd_setImageWithURL:[NSURL URLWithString:model.imgsrc] placeholderImage:[UIImage imageNamed:@"background"]];
        
        self.readCount.text = [self exchangeReply:model.replyCount];
        
       }

}

@end
